package cn.edu.jxau.lang;

import java.util.*;
import java.util.Map.Entry;

/**
 * Desc:
 * ------------------------------------
 * Author:fulei04@meituan.com
 * Date:2017/12/14
 * Time:下午8:33
 */
public class Printer {

    public static void printCollection(Collection<?> collection) {

        System.out.println("---print collection-------------------------------------------");
        System.out.println("size:"+collection.size());
        Iterator iterator = collection.iterator();
        while(iterator.hasNext()) {
            System.out.println(iterator.next());
        }
        System.out.println("--------------------------------------------------------------");
    }

    public static void printEntity(Object obj) {

        System.out.println("---print entity-------------------------------------------");
        System.out.println(obj);
        System.out.println("--------------------------------------------------------------");
    }

    public static void printMap(Map<?,?> map) {

        System.out.println("---print map-------------------------------------------");
        System.out.println("size:"+map.size());
        for(Map.Entry<?,?> entry : map.entrySet()) {
            System.out.println(entry.getKey()+"---"+entry.getValue());
        }
        System.out.println("--------------------------------------------------------------");
    }
}
